package com.chy;

import com.chy.算法.无向图;
import com.chy.设计模式.Singleton02;
import org.junit.Test;

import java.util.Arrays;

public class aa {
    private static int count = 0;
    public static void method(){
        if (count == 200){
            return;
        }
        count++;
        method();
    }

    public static void main(String[] args) {
        try {
            method();
            System.out.println(count);
        } catch (Throwable e) {
            e.printStackTrace();
            System.out.println(count);
        }
    }

    public void hhh(){
        System.out.println("hello");
    }
    private bb bb;
    @Test
    public void test() throws Exception {
        String className = "com.chy.aa";
//        Object o = Class.forName(className).newInstance();
        Object o = Class.forName(className).getConstructor().newInstance();
        ((aa) o).hhh();
        //bb.test();
    }
}

class ab{
    protected void test(){

    }

    final public void fun(){

    }
}

class abc extends ab implements cc{
    public void fun(int a){

    }
    @Override
    public void test() {
        super.test();
    }

    public static void main(String[] args) {
        try {

            System.out.println(cc.a);
            hh hh = new hh();
            hh.test();
        } finally {

        }
    }
    public static class hh{
        public void test() {
            System.out.println(1213);
        }
    }
    public void fun(String a,int b) {
    }
    public void fun(int b,String a) {
    }
//    public void fun(int a,int b) {
//    }
//    public void fun(int b,int a) {
//    }
}

interface cc {
    static final int a = 120;
}

abstract class abs{
    public void fun(){
        //fun2();
    }
}
class abschilde extends abs{
    @Override
    public void fun() {

    }
    public int fun(int i) {
        return 1;
    }
    public void fun2() {
        System.out.println(123);
    }
}
class B extends A {
    public void print() {
        System.out.println("b");
    }

}

abstract class A {
    public void get() {
        print();
    }

    public abstract void print();
}
class Parent {

    private int data;

    public Parent(int d){ data = d; }

    public Parent() {
    }
}

class Child extends Parent{

    String name;

    public Child(String s, int d){

        name = s;

    }

}
class Base
{
    //public static int a = 1;
    public void methodOne()
    {
        System.out.print("A");
        methodTwo();
    }

    public void methodTwo()
    {
        System.out.print("B");
    }
}

class Derived extends Base
{
    public static int a = 2;
    public void methodOne()
    {
        super.methodOne();
        System.out.print("C");
    }

    public void methodTwo()
    {
        super.methodTwo();
        System.out.print("D");
    }
    public void methodThree()
    {
        super.methodTwo();
        System.out.print("D");
    }
    public static void main(String[] args) {
        Base b = new Derived();
        b.methodOne();
//        System.out.println(b.a);
//        b.methodThree();
        Derived derived = new Derived();
        System.out.println(derived.a);
        Student a = new Student("zhangs");
        Student aaab = a;
        System.out.println(aaab.name);
    }
}

class Student{
    public String name;
    Student(String name){
        this.name = name;
    }
}

class student{
    public String name;
}
class student1 extends student{
    public student1(String name) {
        super.name = name;
    }

    @Override
    public String toString() {
        return "student1{" +
                "name='" + name + '\'' +
                '}';
    }

    public static void main(String[] args) {
        student1 a = new student1("zs");
        System.out.println(a.name);
    }
}
